<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>v-model指令</title>
</head>

<body>
    <!-- 

        双向绑定：v-model
     -->
    <div id="app">
        按回车键发送到控制台
        <br>
        <input type="text" v-model="message" @keyup.enter="change">
        <br>
        {{message}}
    </div>

    <script src="./lib/vue.js"></script>
    <script>
        var app = new Vue({
            el: "#app",
            data: {
                message: "黑马程序员"
            },
            methods: {
                change: function () {
                    console.log(this.message);
                    this.message = ""

                }

            }
        })
    </script>
</body>

</html>